﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KBS8.Data.GdfDataFilter
{
    internal abstract class OutputHandler
    {
        /// <summary>
        /// The next handler in the Chain-of-Responsibility
        /// </summary>
        public OutputHandler Successor;
        /// <summary>
        /// The object which has to be changed or edited in the Chain-of-Responsibility
        /// </summary>
        public FilteredOutput Output;

        /// <summary>
        /// The object which defines the gate of this module
        /// </summary>
        public GdfDataFilter Gate;

        /// <summary>
        /// The mehtod performs the action of the handler
        /// </summary>
        public virtual void Handle()
        {
            if (Successor != null)
            {
                Successor.Gate = Gate;
                Successor.Output = Output;
                Successor.Handle();
            }
        }
    }
}
